Method and device for three-dimensional reconstruction

ABSTRACT

The disclosure provides a method and device for three-dimensional reconstruction, applied to the field of image processing. The method includes: obtaining a first depth map, which is photographed by a first photographic device, and obtaining a second depth map, which is photographed by a second photographic device; merging the first depth map with a first three-dimensional model according to a position of the first photographic device to obtain a second three-dimensional model; and merging the second depth map with the second three-dimensional model according to a position of the second photographic device to obtain a third three-dimensional model.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a divisional application of U.S. patent applicationSer. No. 16/143,439, filed on Sep. 26, 2018, which claims priority toChinese Patent Application No. 201710892868.0, filed on Sep. 27, 2017.The contents of these applications are incorporated herein by reference.

TECHNICAL FIELD

The present invention relates to a method and device for imageprocessing, and specifically, relates to a method and device forthree-dimensional reconstruction.

BACKGROUND

At present, research on the related technology of photographingthree-dimensional images has been developed for several decades. Earlydevices for photographing three-dimensional images mainly adopt laser,structured light, large-scale camera arrays and other specializedsensors, the reconstruction precision of three-dimensional models ishigh, but the prices are very high, so that the devices are onlysuitable for large entities, but are not suitable for small businessesor home users. In recent years, with the development of technologies,many low-cost devices for photographing three-dimensional images haveemerged, for example, a depth camera capable of automatically moving isused, such a device requires the user to rotate it multiple anglesaccording to a voice prompt for photographing, and meanwhile the depthcamera automatically moves up and down to photograph depth maps of aphotographed object at all angles. Finally, the depth maps photographedat the various angles are synthesized into a complete three-dimensionalmodel of the photographed object by using an algorithm.

The three-dimensional reconstruction method in the prior art is low ineffect and low in precision on the three-dimensional reconstruction ofthe top and the bottom of a target object.

SUMMARY

A method and device for three-dimensional reconstruction, provided bythe present invention, can solve the problems of poor effect and lowprecision of three-dimensional reconstruction of the top and the bottomof a target object in the prior art.

A first aspect of the present invention provides a method forcalibration, comprising:

obtaining a first depth map, which is photographed by a firstphotographic device, and obtaining a second depth map, which isphotographed by a second photographic device; merging the first depthmap with a first three-dimensional model according to a position of thefirst photographic device to obtain a second three-dimensional model;and merging the second depth map with the second three-dimensional modelaccording to a position of the second photographic device to obtain athird three-dimensional model.

According to the first aspect of the present invention, in a firstexecutable mode of the first aspect of the present invention,

merging the first depth map with a first three-dimensional modelaccording to a position of the first photographic device to obtain asecond three-dimensional model comprises: updating a signed distancefunction according to the position of the first photographic device andthe first depth map to obtain a first signed distance function, whereinthe first signed distance function comprises the secondthree-dimensional model; and merging the second depth map with thesecond three-dimensional model according to a position of the secondphotographic device comprises: updating the first signed distancefunction according to the position of the second photographic device andthe second depth map to obtain a second signed distance function,wherein the second signed distance function comprises the thirdthree-dimensional model.

According to the first aspect of the present invention or the firstexecutable mode of the first aspect of the present invention, in asecond executable mode of the first aspect of the present invention, theposition of at least one of the first photographic device and the secondphotographic device is obtained according to a calibration result.

According to the first aspect of the present invention or the firstexecutable mode or the second executable mode of the first aspect of thepresent invention, in a third executable mode of the first aspect of thepresent invention, the position of the second photographic device iscalculated by the following method: obtaining an initial position of thesecond photographic device according to the position of the firstphotographic device and a relative position between the secondphotographic device and the first photographic device; and performingalignment on the second depth map and the second three-dimensional modelaccording to an initial position of the first photographic device byusing an iterative closest point algorithm to obtain the position of thesecond photographic device.

A second aspect of the present invention provides a method formeasurement, comprising: obtaining a three-dimensional model of ameasured object; fitting a pre-stored measured three-dimensional modelto the three-dimensional model of the measured object; and measuring thethree-dimensional model of the measured object according to the measuredthree-dimensional model and the fitting process.

According to the second aspect of the present invention, in a firstexecutable mode of the second aspect of the present invention, thepre-stored measured three-dimensional model comprise feature measurementmarkers; and measuring the three-dimensional model of the measuredobject according to the measured three-dimensional model and the fittingprocess comprises: measuring the three-dimensional model of the measuredobject according to the feature measurement markers and transformationcorresponding to the fitting.

According to the first executable mode of the second aspect of thepresent invention, in a second executable mode of the second aspect ofthe present invention, the measured object is a human body; the featuremeasurement markers are marking points of the pre-stored measuredthree-dimensional model, and one or more feature measurement markers arelocated on a to-be-measured body circumference of the measuredthree-dimensional model; and measuring the three-dimensional model ofthe measured object according to the feature measurement markers andtransformation corresponding to the fitting comprises: calculatingfitted heights of the one or more feature measurement markers after thefitting according to the heights of the feature measurement markers onthe measured three-dimensional model and the transformationcorresponding to the fitting, obtaining an envelope curve located on thefitted heights on the three-dimensional model of the measured humanbody, and measuring the length of the envelope curve, wherein the lengthof the envelope curve is the value of the to-be-measured bodycircumference of the three-dimensional model of the human body.

According to the first executable mode of the second aspect of thepresent invention, in a third executable mode of the second aspect ofthe present invention, the measured object is a human body; the featuremeasurement markers are an envelope curve of a to-be-measured bodycircumference of the measured three-dimensional model; and measuring thethree-dimensional model of the measured object according to the featuremeasurement markers and transformation corresponding to the fittingcomprises: calculating the length of the above-mentioned envelope curveafter fitting according to the envelope curve of the to-be-measured bodycircumference of the measured three-dimensional model and thetransformation corresponding to the fitting, wherein the length of theenvelope curve is the value of the to-be-measured body circumference ofthe three-dimensional model of the human body.

According to the second executable mode or third executable mode of thesecond aspect of the present invention, in a fourth executable mode ofthe second aspect of the present invention, the to-be-measured bodycircumference comprises at least one of a chest circumference, awaistline and a hip circumference.

According to the second aspect of the present invention or anyexecutable mode of the first executable mode to the fourth executablemode of the second aspect of the present invention, in a fifthexecutable mode of the second aspect of the present invention, themeasured object is a human body; and the fitting comprises at least oneof pose fitting and shape fitting.

A third aspect of the present invention provides a device forthree-dimensional reconstruction, comprising: a first obtaining module,configured to obtain a first depth map, which is photographed by a firstphotographic device, and obtain a second depth map, which isphotographed by a second photographic device; a calculation module,configured to merge the first depth map with a first three-dimensionalmodel according to a position of the first photographic device to obtaina second three-dimensional model; and the calculation module is furtherconfigured to merge the second depth map with the secondthree-dimensional model according to a position of the secondphotographic device to obtain a third three-dimensional model.

According to the third aspect of the present invention, in a firstexecutable mode of the third aspect of the present invention, thecalculation module is specifically configured to update a signeddistance function according to the position of the first photographicdevice and the first depth map to obtain a first signed distancefunction, wherein the first signed distance function comprises thesecond three-dimensional model; and the calculation module isspecifically configured to update the first signed distance functionaccording to the position of the second photographic device and thesecond depth map to obtain a second signed distance function, whereinthe second signed distance function comprises the thirdthree-dimensional model.

According to the third aspect of the present invention or the firstexecutable mode or the second executable mode of the third aspect of thepresent invention, in a third executable mode of the third aspect of thepresent invention, the calculation module is specifically configured toobtain an initial position of the second photographic device accordingto the position of the first photographic device and a relative positionbetween the second photographic device and the first photographicdevice, and perform alignment on the second depth map and the secondthree-dimensional model according to an initial position of the firstphotographic device by using an iterative closest point algorithm toobtain the position of the second photographic device.

A fourth aspect of the present invention provides a device formeasurement, comprising: a second obtaining module, configured to obtaina three-dimensional model of a measured object; a fitting module,configured to fit a pre-stored measured three-dimensional model to thethree-dimensional model of the measured object; and a measurementmodule, configured to measure the three-dimensional model of themeasured object according to the measured three-dimensional model andthe fitting process.

According to the fourth aspect of the present invention, in a firstexecutable mode of the fourth aspect of the present invention, thepre-stored measured three-dimensional model comprises featuremeasurement markers; and the measurement module is specificallyconfigured to measure the three-dimensional model of the measured objectaccording to the feature measurement markers and transformationcorresponding to the fitting.

According to the first executable mode of the fourth aspect of thepresent invention, in a second executable mode of the fourth aspect ofthe present invention, the measured object is a human body; the featuremeasurement markers are marking points of the pre-stored measuredthree-dimensional model, and one or more feature measurement markers arelocated on a to-be-measured body circumference of the measuredthree-dimensional model; and the measurement module is specificallyconfigured to calculate fitted heights of the one or more featuremeasurement markers after the fitting according to the heights of thefeature measurement markers on the measured three-dimensional model andthe transformation corresponding to the fitting, obtain an envelopecurve located on the fitted heights on the three-dimensional model ofthe measured human body, and measure the length of the envelope curve,wherein the length of the envelope curve is the value of theto-be-measured body circumference of the three-dimensional model of thehuman body.

According to the first executable mode of the fourth aspect of thepresent invention, in a third executable mode of the fourth aspect ofthe present invention, the measured object is a human body; the featuremeasurement markers are an envelope curve of a to-be-measured bodycircumference of the measured three-dimensional model; and themeasurement module is specifically configured to calculate the length ofthe above-mentioned envelope curve after the fitting according to theenvelope curve of the to-be-measured body circumference of the measuredthree-dimensional model and the transformation corresponding to thefitting, wherein the length of the envelope curve is the value of theto-be-measured body circumference of the three-dimensional model of thehuman body.

According to the second executable mode or third executable mode of thefourth aspect of the present invention, in a fourth executable mode ofthe fourth aspect of the present invention, the to-be-measured bodycircumference comprises at least one of a chest circumference, awaistline and a hip circumference.

According to the fourth aspect of the present invention or anyexecutable mode of the first executable mode to the fourth executablemode of the fourth aspect of the present invention, in a fifthexecutable mode of the fourth aspect of the present invention, themeasured object is a human body; and the fitting comprises at least oneof pose fitting and shape fitting.

A fifth aspect of the present invention provides a computer readablestorage medium, which stores a computer program, wherein the computerprogram, when executed by a first processor, implements the steps of themethod in the first aspect of the present invention, any executable modeof the first executable mode of the first aspect of the presentinvention to the third executable mode of the first aspect of thepresent invention, the second aspect of the present invention, or anyexecutable mode of the first executable mode of the second aspect of thepresent invention to the fifth executable mode of the second aspect ofthe present invention.

A sixth aspect of the present invention provides a device forcalibration, comprising: a memory, a second processor and a computerprogram which is stored in the memory and can be run on the secondprocessor, wherein the computer program, when executed by the secondprocessor, implements the steps of the method in the first aspect of thepresent invention, any executable mode of the first executable mode ofthe first aspect of the present invention to the third executable modeof the first aspect of the present invention, the second aspect of thepresent invention, and any executable mode of the first executable modeof the second aspect of the present invention to the fifth executablemode of the second aspect of the present invention.

By adoption of the method and device for three-dimensionalreconstruction provided by the present invention, during thereconstruction of three-dimensional images, the reconstruction effect ofthe three-dimensional images of the top and the bottom of the targetobject can be improved, and the precision of the reconstructedthree-dimensional images is improved.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a flow diagram of a method for three-dimensionalreconstruction provided by embodiment 1 of the present invention;

FIG. 2 is a schematic diagram of a device for three-dimensionalreconstruction provided by embodiment 1 of the present invention;

FIG. 3 is a schematic diagram of a signed distance function provided byembodiment 1 of the present invention;

FIG. 4 is a flow diagram of representing a human face by using atwo-dimensional signed distance function provided by embodiment 1 of thepresent invention;

FIG. 5 is a flow diagram of another method for three-dimensionalreconstruction provided by embodiment 1 of the present invention;

FIG. 6 is a flow diagram of a method for measurement provided byembodiment 2 of the present invention;

FIG. 7 is a structural schematic diagram of a device forthree-dimensional reconstruction provided by embodiment 3 of the presentinvention;

FIG. 8 is a structural schematic diagram of a device for measurementprovided by embodiment 4 of the present invention;

FIG. 9 is a structural schematic diagram of a device forthree-dimensional reconstruction or measurement provided by embodiment 5of the present invention;

FIG. 10 is a structural schematic diagram of a device forthree-dimensional reconstruction or measurement provided by embodiment 6of the present invention.

DETAILED DESCRIPTION

The technical solutions in the embodiments of the present invention willbe described in detail below in combination with the accompanyingdrawings in the embodiments of the present invention.

The terms “first”, “second” and the like in the specification, claimsand drawings of the present invention are used for distinguishingdifferent objects, rather than limiting specific sequences.

The term “and/or” in the embodiments of the present invention is merelya correlation for describing correlated objects, and indicates threepossible relations, e.g., A and/or B may indicate three situations: onlyA exists, both A and B exist, and only B exists.

In the embodiments of the present invention, the words such as“exemplary” or “for example” are used for indicating an example or anillustrative example or illustration. Any embodiment or design schemedescribed as “exemplary” or “for example” in the embodiments of thepresent invention should not be interpreted as being more preferable ormore advantageous than other embodiments or design schemes. Exactly, thewords such as “exemplary” or “for example” are used for presentingrelevant concepts in specific manners.

It should be noted that, for the sake of brevity and clearness of thedrawings, the components shown in the drawings do not need to be drawnto scale. For example, for the sake of clearness, the sizes of somecomponents can be increased relative to other components. In addition,reference signs can be repeated, where appropriate, among the drawingsto indicate corresponding or similar components in view of this.

A method for three-dimensional reconstruction provided by embodiment 1of the present invention is illustrated below in detail in combinationwith FIG. 1. As shown in FIG. 1, the method comprises:

Step 101, obtaining a first depth map, which is photographed by a firstphotographic device, and obtaining a second depth map, which isphotographed by a second photographic device.

Optionally, the first depth map and/or the second depth map describedabove may be obtained from a storage device, which may be an RAM (RandomAccess Memory), a flash memory or the like. Optionally, the firstphotographic device and/or the second photographic device may be a depthphotographic device. The sequence of obtaining the first depth map andobtaining the second depth map described above is not limited, the firstdepth map may be obtained first and then the second depth map isobtained, or vice versa.

Step 102, merging the first depth map with a first three-dimensionalmodel according to a position of the first photographic device to obtaina second three-dimensional model.

Step 103, merging the second depth map with the second three-dimensionalmodel according to a position of the second photographic device toobtain a third three-dimensional model.

Optionally, merging the first depth map with a first three-dimensionalmodel according to a position of the first photographic device to obtaina second three-dimensional model comprises: updating a signed distancefunction according to the position of the first photographic device andthe first depth map to obtain a first signed distance function, whereinthe first signed distance function comprises the secondthree-dimensional model; and merging the second depth map with thesecond three-dimensional model according to a position of the secondphotographic device comprises: updating the first signed distancefunction according to the position of the second photographic device andthe second depth map to obtain a second signed distance function,wherein the second signed distance function comprises the thirdthree-dimensional model.

Optionally, merging the first depth map with a first three-dimensionalmodel according to a position of the first photographic device to obtaina second three-dimensional model may comprise: if the firstthree-dimensional model is represented by a point cloud, performingalignment on the depth map and the point cloud according to the positionof the first photographic device to obtain the second three-dimensionalmodel.

Optionally, the position of at least one of the first photographicdevice and the second photographic device is obtained according to acalibration result.

Optionally, the position of the second photographic device is calculatedby the following method: obtaining an initial position of the secondphotographic device according to the position of the first photographicdevice and a relative position between the second photographic deviceand the first photographic device; and performing alignment on thesecond depth map and the second three-dimensional model according to aninitial position of the first photographic device by using an iterativeclosest point algorithm to obtain the position of the secondphotographic device.

Optionally, the position of the first photographic device describedabove may be represented by a transformation matrix of a coordinatesystem of the first photographic device relative to the coordinatesystem of the reconstructed three-dimensional model, and this is alsothe case for the second photographic device. Optionally, thetransformation matrix may be obtained by calibration, and may also becalculated from the transformation matrix relative to the calibratedphotographic device and the position of the calibrated photographicdevice. For example, when the position of the first photographic deviceis known by calibration, and the relative position, namely relativeposition, of the second photographic device relative to the firstphotographic device is obtained, and then the position of the secondphotographic device relative to the reconstructed three-dimensionalmodel may be obtained.

Specifically, exemplarily, as shown in FIG. 2, FIG. 2 shows a device forthree-dimensional reconstruction that can use the method of the presentinvention. 201, 202 and 203 respectively comprise depth photographicdevices for photographing depth maps. Optionally, the above-mentionedthree-dimensional reconstruction method may also be accomplished byusing two depth photographic devices, for example, 201 represents thefirst photographic device, and 202 represents the second photographicdevice. 204 represents a turntable for placing a measured object.

In the present invention, a signed distance function (SDF) may be usedto represent a currently reconstructed three-dimensional model: ato-be-scanned area is evenly divided into a series of small cubes(voxels), each voxel records a signed distance from the reconstructedthree-dimensional model, the signed distances of the voxels inside theobject are negative, the signed distances of the voxels outside theobject are positive, and the signed distances of the surfaces of theobject are zero. Therefore, one signed distance function comprises athree-dimensional model. As shown in FIGS. 3 and 4, FIG. 3 shows asigned distance function comprising a series of voxels, and FIG. 4 showsa schematic diagram representing a human face in a two-dimensionaldirection by using the signed distance function, the signed distancesare all positive from the reconstructed three-dimensional model to theside of the camera are positive, and are all negative to the other side,the greater the distance from a grid point to the reconstructedthree-dimensional model is, the greater the absolute value is, andcrossing points from positive to negative in the grid represent thesurfaces of the reconstructed three-dimensional model, in this way, thesigned distance function can represent the reconstructedthree-dimensional model. When the depth map is merged with thethree-dimensional model, the values of corresponding voxels in theabove-mentioned signed distance function are updated via the obtained atleast one depth map of different angle to accomplish the above-mentionedmerging. Optionally, the corresponding relation between the pixels inthe depth map and the above-mentioned voxels may be obtained via therelation between the coordinate system of the photographic device andthe coordinate system of the reconstructed three-dimensional model.

In the present invention, at least two depth photographic devices sharea unified signed distance function, and the visual domain of each depthphotographic device covers a part of the signed distance function. Thereis an intersection between the visual domains of the photographic device202 in the middle and the photographic device 201 at the upper side,and/or between the visual domains of the photographic device 202 in themiddle and the photographic device 203 at the lower side. Such designnot only ensures the smooth execution of the tracing algorithm of thephotographic devices, but also avoids the mutual interference betweenthe depth photographic devices as much as possible.

As shown in FIG. 5, the method for obtaining the three-dimensional modelvia two or more depth photographic devices is specifically describedbelow by using the three depth photographic devices in FIG. 2.Optionally, the sequence of merging the depth maps photographed by theabove-mentioned three depth photographic devices may be from the depthmap photographed by the 201 to the depth map photographed by the 202 tothe depth map photographed by the 203, and may also be 202—

203—

201, and this is not limited in the present invention. With the sequenceof 201—

202—

203 as an example, the first depth map photographed by the firstphotographic device 201 is obtained, the initial position of the camera201 is obtained according to the calibration result, and the signeddistance function is updated according to the position. The sequence ofobtaining the depth map and calculating the position can be reversed,which is not limited in the present invention.

Then, the second depth map photographed by the second photographicdevice 202 is obtained, the initial position of the second photographicdevice 202 is calculated according to the position of the firstphotographic device 201, and the relative position between the firstphotographic device 201 and the second photographic device 202 obtainedduring the calibration, and then ICP alignment is performed on the depthmap obtained by the second photographic device 202 and the updatedsigned distance function described above by using an ICP algorithm toobtain the position of the second photographic device 202, and thesigned distance function is updated according to the position. In thisway, the depth maps photographed by the three depth photographic devicesare read in turn to continuously improve the three-dimensional model.Optionally, every time after the position of the current depthphotographic device is estimated, it is determined whether one rotationhas been performed to serve as the determination condition of automatictermination.

By adoption of the method for three-dimensional reconstruction providedby the embodiment of the present invention, during the reconstruction ofthree-dimensional images, the reconstruction effect of thethree-dimensional images of the top and the bottom of the target objectcan be improved, and the precision of the reconstructedthree-dimensional images is improved.

A method for measurement provided by embodiment 2 of the presentinvention is illustrated below in detail in combination with FIG. 6. Asshown in FIG. 6, the method comprises:

Step 601, obtaining a three-dimensional model of a measured object.

Optionally, the measured object may be a human body.

Step 602, fitting a pre-stored measured three-dimensional model to thethree-dimensional model of the measured object.

Optionally, the measured object is a human body, and the fittingcomprises at least one of pose fitting and shape fitting.

Step 603, measuring the three-dimensional model of the measured objectaccording to the measured three-dimensional model and the fittingprocess.

Optionally, the pre-stored measured three-dimensional model comprisefeature measurement markers; and measuring the three-dimensional modelof the measured object according to the measured three-dimensional modeland the fitting process comprises: measuring the three-dimensional modelof the measured object according to the feature measurement markers andtransformation corresponding to the fitting.

Optionally, the measured object is a human body; the feature measurementmarkers are marking points of the pre-stored measured three-dimensionalmodel, and one or more feature measurement markers are located on ato-be-measured body circumference of the measured three-dimensionalmodel; and measuring the three-dimensional model of the measured objectaccording to the feature measurement markers and transformationcorresponding to the fitting comprises: calculating fitted heights ofthe one or more feature measurement markers after the fitting accordingto the heights of the feature measurement markers on the measuredthree-dimensional model and the transformation corresponding to thefitting, obtaining an envelope curve located on the fitted heights onthe three-dimensional model of the measured human body, and measuringthe length of the envelope curve, wherein the length of the envelopecurve is the value of the to-be-measured body circumference of thethree-dimensional model of the human body. Optionally, theabove-mentioned marking point may have a mark number, and the markingpoint on the to-be-measured body circumference after the fitting may befound via the above-mentioned mark number.

Optionally, the measured obj ect is a human body; the featuremeasurement markers are an envelope curve of a to-be-measured bodycircumference of the measured three-dimensional model; and measuring thethree-dimensional model of the measured object according to the featuremeasurement markers and transformation corresponding to the fittingcomprises: calculating the length of the above-mentioned envelope curveafter fitting according to the envelope curve of the to-be-measured bodycircumference of the measured three-dimensional model and thetransformation corresponding to the fitting, wherein the length of theenvelope curve is the value of the to-be-measured body circumference ofthe three-dimensional model of the human body.

Optionally, feature measurement markers with different shapes may bedesigned according to different measurement applications, for example, afeature measurement marker may also be a linear segment, a curvesegment, etc.

Specifically, a three-dimensional human body database is obtained bycollecting a large number of human body models of different body types.These human body models are collected at the same standard pose, and thethree-dimensional human body database may be formed by one measuredthree-dimensional model and several feature vectors. In this way, onehuman body model may be represented as a linear combination of themeasured three-dimensional model and the feature vectors.

The human body fitting process may be: inputting a human body scanningmodel, iteratively performing pose fitting and/or shape fittingaccording to the three-dimensional human body database untilconvergence, such as: the fitting error is reduced to a fixed range. Theabove fitting process corresponds to a transformation matrix.

Simply put, the pose fitting is used for describing the overall shape ofthe human body, for example the arms splay to both sides or are akimboand so on. In order to represent the human bodies in different poses, askeleton may be added to the human body database, and the skeletondrives the stored three-dimensional model to be transformed from astandard pose to other pose. The skeleton is a simplified version ofhuman body skeletons and is composed of a number of joint points, eachof which is connected with a number of other joint points. The posefitting (or pose estimation) may also refer to estimating the pose(comprising three-dimensional spatial position and rotation angle) ofthe joint point according to the reconstructed three-dimensional model.

The shape fitting may refer to estimating the shape of the surfaces ofthe three-dimensional model according to the reconstructedthree-dimensional model, which reflects the degree of body fatness, thedegree of different muscles, and the like. Optionally, the shape fittingmay adopt a principal component analysis (PCA) method. Optionally, theshape fitting may be performed after the pose fitting.

Optionally, the measurement of the measured object may be the bodycircumference measurement of the human body, for example, chestcircumference, hip circumference and/or waistline. For example, when thechest circumference is measured, feature measurement marking points on achest circumference line of the measured three-dimensional model arerecorded. After the human body fitting, the fitted heights of thesefeature measurement marking points are calculated on thethree-dimensional model obtained by fitting, and a parallel surface ofthe fitted heights is crossed with a scanned trunk position of thethree-dimensional model of the measured human body to obtain theenvelope curve of the cross section, and the obtained envelope curve ofthe cross section is a measured chest circumference value.

Compared with the method of finding feature points in the prior, themethod disclosed by the embodiment of the present invention has theadvantages that the measurement method based on fitting of the presentinvention is high in speed, stable and reliable in result and high inexpandability.

A device for three-dimensional reconstruction provided by embodiment 3of the present invention is illustrated below in detail in combinationwith FIG. 7. As shown in FIG. 7, the device comprises: a first obtainingmodule 701 and a calculation module 702,

the first obtaining module 701 is configured to obtain a first depthmap, which is photographed by a first photographic device, and obtain asecond depth map, which is photographed by a second photographic device.

Optionally, the first depth map and/or the second depth map describedabove may be obtained from a storage device, which may be an RAM (RandomAccess Memory), a flash memory or the like. Optionally, the firstphotographic device and/or the second photographic device may be a depthphotographic device. The sequence of obtaining the first depth map andobtaining the second depth map described above is not limited, the firstdepth map may be obtained first and then the second depth map isobtained, or vice versa.

The calculation module 702 is configured to merge the first depth mapwith a first three-dimensional model according to a position of thefirst photographic device to obtain a second three-dimensional model;and the calculation module 702 is further configured to merge the seconddepth map with the second three-dimensional model according to aposition of the second photographic device to obtain a thirdthree-dimensional model.

Optionally, the first three-dimensional model may be represented by apoint cloud. The calculation module 702 is further configured to performalignment on the depth map and the point cloud according to the positionof the first photographic device to obtain the second three-dimensionalmodel.

Optionally, the calculation module 701 is specifically configured toupdate a signed distance function according to the position of the firstphotographic device and the first depth map to obtain a first signeddistance function, wherein the first signed distance function comprisesthe second three-dimensional model; and the calculation module 702 isspecifically configured to update the first signed distance functionaccording to the position of the second photographic device and thesecond depth map to obtain a second signed distance function, whereinthe second signed distance function comprises the thirdthree-dimensional model.

Optionally, the position of at least one of the first photographicdevice and the second photographic device is obtained according to acalibration result.

Optionally, the calculation module 702 is specifically configured toobtain an initial position of the second photographic device accordingto the position of the first photographic device and a relative positionbetween the second photographic device and the first photographicdevice, and perform alignment on the second depth map and the secondthree-dimensional model according to an initial position of the firstphotographic device by using an iterative closest point algorithm toobtain the position of the second photographic device

Optionally, the position of the first photographic device describedabove may be represented by a transformation matrix of a coordinatesystem of the first photographic device relative to the coordinatesystem of the reconstructed three-dimensional model, and this is alsothe case for the second photographic device. Optionally, thetransformation matrix may be obtained by calibration, and may also becalculated from the transformation matrix relative to the calibratedphotographic device and the position of the calibrated photographicdevice. For example, when the position of the first photographic deviceis known by calibration, and the relative position, namely relativeposition, of the second photographic device relative to the firstphotographic device is obtained, and then the position of the secondphotographic device relative to the reconstructed three-dimensionalmodel may be obtained.

With respect to description of specific functions and/or structures ofthe device, reference may be made to the related description of FIGS. 2to 5 in embodiment 1.

By adoption of the device for three-dimensional reconstruction providedby the embodiment of the present invention, during the reconstruction ofthree-dimensional images, the reconstruction effect of thethree-dimensional images of the top and the bottom of the target objectcan be improved, and the precision of the reconstructedthree-dimensional images is improved.

A device for measurement provided by embodiment 4 of the presentinvention is illustrated below in detail in combination with FIG. 8. Asshown in FIG. 8, the device comprises: a second obtaining module 801, afitting module 802 and a measurement module 803.

The second obtaining module 801 is configured to obtain athree-dimensional model of a measured object.

Optionally, the measured object may be a human body.

The fitting module 802 is configured to fit a pre-stored measuredthree-dimensional model to the three-dimensional model of the measuredobject.

Optionally, the measured object is a human body, and the fittingcomprises at least one of pose fitting and shape fitting.

The measurement module 803 is configured to measure thethree-dimensional model of the measured object according to the measuredthree-dimensional model and the fitting process.

Optionally, the pre-stored measured three-dimensional model comprisesfeature measurement markers; and the measurement module 803 isspecifically configured to measure the three-dimensional model of themeasured object according to the feature measurement markers andtransformation corresponding to the fitting.

Optionally, the measured object is a human body; the feature measurementmarkers are marking points of the pre-stored measured three-dimensionalmodel, and one or more feature measurement markers are located on ato-be-measured body circumference of the measured three-dimensionalmodel; and the measurement module 803 is specifically configured tocalculate fitted heights of the one or more feature measurement markersafter the fitting according to the heights of the feature measurementmarkers on the measured three-dimensional model and the transformationcorresponding to the fitting, obtain an envelope curve located on thefitted heights on the three-dimensional model of the measured humanbody, and measure the length of the envelope curve, wherein the lengthof the envelope curve is the value of the to-be-measured bodycircumference of the three-dimensional model of the human body.Optionally, the above-mentioned marking point may have a mark number,and the marking point on the to-be-measured body circumference after thefitting may be found via the above-mentioned mark number.

Optionally, the measured object is a human body; the feature measurementmarkers are an envelope curve of a to-be-measured body circumference ofthe measured three-dimensional model; and the measurement module 803 isspecifically configured to calculate the length of the above-mentionedenvelope curve after the fitting according to the envelope curve of theto-be-measured body circumference of the measured three-dimensionalmodel and the transformation corresponding to the fitting, wherein thelength of the envelope curve is the value of the to-be-measured bodycircumference of the three-dimensional model of the human body.

Specifically, a three-dimensional human body database is obtained bycollecting a large number of human body models of different body types.These human body models are collected at the same standard pose, and thethree-dimensional human body database may be formed by one measuredthree-dimensional model and several feature vectors. In this way, onehuman body model may be represented as a linear combination of themeasured three-dimensional model and the feature vectors.

The human body fitting process may be: inputting a human body scanningmodel, iteratively performing pose fitting and/or shape fittingaccording to the three-dimensional human body database untilconvergence, such as: the fitting error is reduced to a fixed range. Theabove fitting process corresponds to a transformation matrix.

Simply put, the pose fitting is used for describing the overall shape ofthe human body, for example the arms are splay both sides or are akimboand so on. In order to represent the human bodies in different poses, askeleton may be added to the human body database, and the skeletondrives the stored three-dimensional model to be transformed from astandard pose to other poses. The skeleton is a simplified version ofhuman body skeletons and is composed of a number of joint points, eachof which is connected with a number of other joint points. The posefitting (or pose estimation) may also refer to estimating the pose(comprising three-dimensional spatial position and rotation angle) ofthe joint point according to the reconstructed three-dimensional model.For example, parameters representing the positions of theabove-mentioned joint points and the rotating directions of the jointpoints are defined, and values of the parameters representing thepositions of the above-mentioned joint points and the rotatingdirections of the joint points are determined according to thereconstructed three-dimensional model.

The shape fitting may refer to estimating the shape of the surface ofthe three-dimensional model according to the reconstructedthree-dimensional model, which reflects the degree of body fatness, thedegree of different muscles, and the like. Optionally, the shape fittingmay adopt a principal component analysis (PCA) method. Optionally, theshape fitting may be performed after the pose fitting.

Optionally, the to-be-measured body circumference comprises at least oneof a chest circumference, a waistline and a hip circumference. Forexample, when the chest circumference is measured, feature measurementmarking points on a chest circumference line of the measuredthree-dimensional model are recorded. After the human body fitting, thefitted heights of these feature measurement marking points arecalculated on the three-dimensional model obtained by fitting, and aparallel surface of the fitted heights is crossed with a scanned trunkposition of the three-dimensional model of the measured human body toobtain the envelope curve of the cross section, and the obtainedenvelope curve of the cross section is a measured chest circumferencevalue.

Optionally, feature measurement markers with different shapes may bedesigned according to different measurement applications, for example, afeature measurement marker may be a linear segment, a curve segment,etc.

Compared with the device of finding feature points in the prior, thedevice disclosed by the embodiment of the present invention has theadvantages that the measurement method based on fitting of the presentinvention is high in speed, stable and reliable in result and high inexpandability.

A device 900 for three-dimensional reconstruction or measurementprovided by embodiment 5 of the present invention will be specificallydescribed below in combination with FIG. 9. The device comprises acomputer readable storage medium 901, which stores a computer program,wherein the computer program, when executed by a first processor 902,implements the steps of the method in embodiment 1 or embodiment 2. Asshown in FIG. 9, optionally, the device 900 may comprise a bus.

By adoption of the device for three-dimensional reconstruction providedby the embodiment of the present invention, during the reconstruction ofthree-dimensional images, the reconstruction effect of thethree-dimensional images of the top and the bottom of the target objectcan be improved, and the precision of the reconstructedthree-dimensional images is improved. Compared with the device offinding feature points in the prior, the device disclosed by theembodiment of the present invention has the advantages that themeasurement method based on fitting of the present invention is high inspeed, stable and reliable in result and high in expandability.

A device 1000 for three-dimensional reconstruction or measurementprovided by embodiment 6 of the present invention will be specificallydescribed below in combination with FIG. 10. The device comprises amemory 1001, a second processor 1002 and a computer program which isstored in the memory 1001 and can be run on the second processor 1002,wherein the computer program, when executed by the second processor1002, implements the steps of the method in embodiment 1 or embodiment2. Optionally, as shown in the figure, the device 1000 may comprise abus.

By adoption of the device for three-dimensional reconstruction providedby the embodiment of the present invention, during the reconstruction ofthree-dimensional images, the reconstruction effect of thethree-dimensional images of the top and the bottom of the target objectcan be improved, and the precision of the reconstructedthree-dimensional images is improved. Compared with the device offinding feature points in the prior, the device disclosed by theembodiment of the present invention has the advantages that themeasurement method based on fitting of the present invention is high inspeed, stable and reliable in result and high in expandability.

Exemplarily, the computer program may be segmented into one or moremodules/units, and the one or more modules/units are stored in thememory and executed by the processor to accomplish the presentinvention. The one or more modules/units may be a series of computerprogram instruction segments which can achieve specific functions, andthe instruction segments are used for describing the execution processof the computer program in the device/terminal equipment.

The device/terminal equipment may be computing equipment such as amobile phone, a tablet computer, a desktop computer, a notebookcomputer, a palm computer, a cloud server or the like. Thedevice/terminal equipment may comprise, but not limited to, a processoror a memory. It could be understood by those skilled in the art that theschematic diagrams of the present invention are merely examples of thedevice/terminal equipment, instead of limiting the device/terminalequipment, which may comprise more or less components than in thediagrams, or combine some components or different components, e.g., thedevice/terminal equipment may further comprise input/output equipment,network access equipment, a bus, etc.

The foregoing processor may be a central processing unit (CPU), and mayalso be other general processor, a digital signal processor (DSP), anapplication specific integrated circuit (ASIC), a field-programmablegate array (FPGA) or other programmable logic device, a discrete gate ortransistor logic device, a discrete hardware component, etc. The generalprocessor may be a microprocessor or any conventional processor or thelike, and the processor is a control center of the device/terminalequipment and connects all parts of the whole device/terminal equipmentby using various interfaces and lines.

The memory may be configured to store the computer program and/ormodules, and the processor achieves various functions of thedevice/terminal equipment by running or executing the computer programand/or modules stored in the memory and calling data stored in thememory. The memory may comprise a program storage area and a datastorage area, wherein the program storage area may store an operatingsystem, an application program required by at least one function (e.g.,image playing function, etc.), etc.; and the data storage area may storedata (e.g., video data, images, etc.) created according to the use ofthe mobile phone. Moreover, the memory may comprise a high-speed randomaccess memory, and may also comprise a non-volatile memory such as ahard disk, a memory or a plug-in hard disk, a smart media card (SMC), asecure digital (SD) card, a flash card, at least one hard disk storagedevice, a flash device, or other non-volatile solid-state storagedevice.

When the modules/units integrated in the device/terminal equipment areimplemented in the form of software functional units and sold or used asindependent products, they may be stored in a computer readable storagemedium. Based on such an understanding, all of or part of processes inthe methods of the above-mentioned embodiments of the present inventionmay also be implemented with a computer program instructingcorresponding hardware. The computer program may be stored in a computerreadable storage medium. The computer program, when executed by theprocessor, can implement the steps of the method embodiments describedabove. The computer program comprises computer program codes, which maybe in the form of source codes, object codes or executable files, or insome intermediate forms, etc. The computer readable medium may compriseany entity or device which can carry the computer program codes, arecording medium, a USB flash disk, a mobile hard disk, a magnetic disk,an optical disk, a computer memory, a read-only memory (ROM), a randomaccess memory (RAM), an electric carrier signal, an electrical signal, asoftware distribution medium, etc.

Imaging of the target object in the embodiments described above may bepartial imaging or integral imaging of the target object. Whichever ofthe partial imaging or the integral imaging, or a correspondingadjustment made to the partial imaging or the integral imaging isadopted is applicable to the method or device provided by the presentinvention. The foregoing adjustment made by those of ordinary skill inthe art without any creative effort shall fall into the protection scopeof the present invention.

What is claimed is:
 1. A method for measurement, comprising: obtaining athree-dimensional model of a measured object; fitting a pre-storedmeasured three-dimensional model to the three-dimensional model of themeasured object; and measuring the three-dimensional model of themeasured object according to the pre-stored measured three-dimensionalmodel and the fitting.
 2. The method according to claim 1, wherein: thepre-stored measured three-dimensional model comprises featuremeasurement markers; and measuring the three-dimensional model of themeasured object according to the pre-stored measured three-dimensionalmodel and the fitting process comprises measuring the three-dimensionalmodel of the measured object according to the feature measurementmarkers and the fitting.
 3. The method according to claim 2, wherein:the measured object is a human body; the feature measurement markers aremarking points of the pre-stored measured three-dimensional model; oneor more feature measurement markers are located on a body circumferenceof the pre-stored measured three-dimensional model; and measuring thethree-dimensional model of the measured object according to the featuremeasurement markers and the fitting comprises: calculating fittedheights of the one or more feature measurement markers after the fittingaccording to heights of the feature measurement markers on thepre-stored measured three-dimensional model and the fitting; obtainingan envelope curve located on the fitted heights on the three-dimensionalmodel of the human body; and measuring the length of the envelope curve,wherein the length of the envelope curve is the value of a bodycircumference of the three-dimensional model of the human body.
 4. Themethod according to claim 2, wherein: the measured object is a humanbody; the feature measurement markers are an envelope curve of a bodycircumference of the pre-stored measured three-dimensional model;measuring the three-dimensional model of the measured object accordingto the feature measurement markers and the fitting comprises calculatingthe length of the envelope curve after fitting according to the envelopecurve of the body circumference of the pre-stored measuredthree-dimensional model and the fitting; and the length of the envelopecurve is the value of a body circumference of the three-dimensionalmodel of the human body.
 5. The method according to claim 3, wherein thebody circumference comprises at least one of a chest circumference, awaistline, and a hip circumference.
 6. The method according to claim 1,wherein: the measured object is a human body; and the fitting comprisesat least one of pose fitting and shape fitting.
 7. A device formeasurement, comprising: an obtaining module, configured to obtain athree-dimensional model of a measured object; a fitting module,configured to fit a pre-stored measured three-dimensional model to thethree-dimensional model of the measured object; and a measurementmodule, configured to measure the three-dimensional model of themeasured object according to the pre-stored measured three-dimensionalmodel and fitting the pre-stored measured three-dimensional model to thethree-dimensional model of the measured object.
 8. The device accordingto claim 7, wherein: the pre-stored measured three-dimensional modelcomprises feature measurement markers; and the measurement module isconfigured to measure the three-dimensional model of the measured objectaccording to the feature measurement markers and the fitting.
 9. Thedevice according to claim 8, wherein: the measured object is a humanbody; the feature measurement markers are marking points of thepre-stored measured three-dimensional model, and one or more featuremeasurement markers are located on a body circumference of thepre-stored measured three-dimensional model; and the measurement moduleis configured to: calculate fitted heights of the one or more featuremeasurement markers after the fitting according to heights of thefeature measurement markers on the pre-stored measured three-dimensionalmodel and the fitting; obtain an envelope curve located on the fittedheights on the three-dimensional model of the human body; and measurethe length of the envelope curve, wherein the length of the envelopecurve is the value of a body circumference of the three-dimensionalmodel of the human body.
 10. The device according to claim 8, wherein:the measured object is a human body; the feature measurement marker arean envelope curve of a body circumference of the pre-stored measuredthree-dimensional model; the measurement module is configured tocalculate the length of the envelope curve after the fitting accordingto the envelope curve of the body circumference of the pre-storedmeasured three-dimensional model and the fitting; and the length of theenvelope curve is the value of a body circumference of thethree-dimensional model of the human body.
 11. The device according toclaim 9, wherein the body circumference comprises at least one of achest circumference, a waistline, and a hip circumference.
 12. Thedevice according to claim 7, wherein: the measured object is a humanbody; and the fitting comprises at least one of pose fitting and shapefitting.